<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    {% block title %}
    {% endblock %}
{% block head %}
    {% endblock %}
    <style>
        /* 基础样式 */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Arial, sans-serif;
        }

        /* 导航栏 */
        .navbar {
            background: #fff;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            padding: 1rem 5%;
            position: fixed;
            width: 100%;
            top: 0;
            z-index: 1000;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logo {
            font-size: 1.5rem;
            color: #2c7a47;
            font-weight: bold;
        }

        .nav-links {
            display: flex;
            gap: 2rem;
        }

        .nav-links a {
            text-decoration: none;
            color: #333;
            transition: color 0.3s;
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .nav-links {
                display: none;
            }

            .mobile-menu-btn {
                display: block;
            }
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar">
        <div class="logo">农业之家</div>
        <div class="nav-links">
            <a href="{% url 'SalesApp:index' %}">首页</a>
            <a href="{% url 'SalesApp:Sales_products' %}">产品</a>
            <a href="{% url 'SalesApp:Sales_join' %}">商家入驻</a>
            <a href="{% url 'SalesApp:Sales_login' %}">商品管理</a>
            <a href="{% url 'SalesApp:Sales_information' %}">农业资讯</a>
            <a href="{% url 'SalesApp:Sales_AboutUs' %}">关于我们</a>
            <a href="{% url 'SalesApp:Sales_ContactUs' %}">联系我们</a>
        </div>
    </nav>

    {% block main %}
    {% endblock %}



    <script>
        // 简单的移动端菜单切换
        document.addEventListener('DOMContentLoaded', () => {
            const mobileMenuBtn = document.createElement('button');
            mobileMenuBtn.className = 'mobile-menu-btn';
            mobileMenuBtn.innerHTML = '☰';

            const navbar = document.querySelector('.navbar');
            navbar.appendChild(mobileMenuBtn);

            mobileMenuBtn.addEventListener('click', () => {
                document.querySelector('.nav-links').classList.toggle('active');
            });
        });

        // 页面滚动效果
        window.addEventListener('scroll', () => {
            if (window.scrollY > 100) {
                document.querySelector('.navbar').style.backgroundColor = 'rgba(255,255,255,0.95)';
            } else {
                document.querySelector('.navbar').style.backgroundColor = '#fff';
            }
        });
    </script>
</body>
</html>